package com.authine.cloudpivot.ext.vo.zhende.order;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.xml.bind.annotation.*;
import java.util.List;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "ispoheader",
    "titem"
})
@XmlRootElement(name = "s4:MT_1240_MM_PO_CREATE_REQ")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class MT1240MMPOCREATEREQ {

    @XmlElement(name = "IS_PO_HEADER", required = true)
    protected ISPOHEADER ispoheader;
    @XmlElement(name = "T_ITEM", required = true)
    protected List<TITEM> titem;

    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "bsart",
        "lifnr",
        "ekorg",
        "ekgrp",
        "bukrs",
        "submi",
        "zfornum"
    })
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    public static class ISPOHEADER {

        @XmlElement(name = "BSART", required = true)
        // 采购凭证类型
        protected String bsart;
        @XmlElement(name = "LIFNR", required = true)
        // 供应商
        protected String lifnr;
        @XmlElement(name = "EKORG", required = true)
        // 采购组织
        protected String ekorg;
        @XmlElement(name = "EKGRP", required = true)
        // 采购组
        protected String ekgrp;
        @XmlElement(name = "BUKRS", required = true)
        // 公司代码
        protected String bukrs;
        @XmlElement(name = "SUBMI", required = true)
        // 汇总号
        protected String submi;
        @XmlElement(name = "ZFORNUM", required = true)
        // 外部订单号
        protected String zfornum;

    }

    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "matnr",
        "werks",
        "menge",
        "meins",
        "netpr",
        "peinh",
        "mwskz",
        "eindt"
    })
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    public static class TITEM {

        @XmlElement(name = "MATNR", required = true)
        // 物料编号
        protected String matnr;
        @XmlElement(name = "WERKS", required = true)
        // 工厂
        protected String werks;
        @XmlElement(name = "MENGE", required = true)
        // 数量
        protected Double menge;
        @XmlElement(name = "MEINS", required = true)
        // 单位
        protected String meins;
        @XmlElement(name = "NETPR", required = true)
        // 单价
        protected String netpr;
        @XmlElement(name = "PEINH", required = true)
        // 价格单位
        protected Integer peinh;
        @XmlElement(name = "MWSKZ", required = true)
        // 税码
        protected String mwskz;
        @XmlElement(name = "EINDT", required = true)
        // 项目交货日期
        protected String eindt;

    }

}
